<template>
  <RollDetails v-model="visible" :param="currentParam" />
</template>

<script setup lang="ts">
import { ref, defineProps, defineExpose } from 'vue'
import RollDetails from '/@/views/common/RollPosImage/RollDetails.vue'

const props = defineProps<{
  rGroup: string
  svgUrl?: string
}>()

const visible = ref(false)
const currentParam = ref<{ line: string; rGroup: string; area: string; pos: string; rType: string }>({
  line: '',
  rGroup: props.rGroup,
  area: '',
  pos: '',
  rType: ''
})

function openDetails(param?: Partial<{ line: string; rGroup: string; area: string; pos: string; rType: string }>) {
  if (param) {
    currentParam.value = {
      line: param.line ?? currentParam.value.line,
      rGroup: param.rGroup ?? currentParam.value.rGroup,
      area: param.area ?? currentParam.value.area,
      pos: param.pos ?? currentParam.value.pos,
      rType: param.rType ?? currentParam.value.rType
    }
  }
  visible.value = true
}

defineExpose({ openDetails })
</script>

<style scoped>
</style>


